﻿using PlatformNetCore.Entity;
using System;
using System.Linq;
using System.Linq.Expressions;
using Webdiyer.AspNetCore;
using PlatformNetCore.IRepository;

namespace PlatformNetCore.Repository
{
    public class AdSlotRepository : Repository<AdSlot>, IAdSlotRepository
    {
        public AdSlotRepository(PlatformContext dbContext) : base(dbContext)
        {

        }
        public override PagedList<AdSlot> GetPagedList(int pageIndex, int pageSize, Expression<Func<AdSlot, bool>> predicate)
        {
            return _dbContext.AdSlot.Where(predicate).OrderByDescending(m => m.AddDate).ToPagedList(pageIndex, pageSize);
        }
    }
}
